'''
* This is the projet for Brtc LlmOps Platform
* @Author Leon-liao <liaosiliang@alltman.com>
* @Description //TODO 
* @File: 1_study_google_serper_tool.py
* @Time: 2025/10/22
* @All Rights Reserve By Brtc
'''
import dotenv
from langchain_community.tools import GoogleSerperRun
from langchain_community.utilities import GoogleSerperAPIWrapper
from pydantic import BaseModel, Field

dotenv.load_dotenv()
class GoogleSerperSchema(BaseModel):
    query:str = Field(description="执行谷歌搜索的查询语句")

google_serper = GoogleSerperRun(
    name = "google_serper",
    description = (
       "一个低成本的谷歌搜索工具"
       "当你想要回答有关问题的时候,可以调用该工具"
       "该工具的输入是搜索查询语句"),
        api_wrapper=GoogleSerperAPIWrapper()
)
print(google_serper.invoke("今天黄金的价格"))